package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单对象 order
 * 
 * @author ruoyi
 * @date 2023-12-24
 */
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    private Long orderID;

    /** 订单总价 */
    @Excel(name = "订单总价")
    private BigDecimal allPrice;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date orderTime = null;

    public Order(){
        this.allPrice = BigDecimal.valueOf(0);
        this.orderID = null; // 或者根据需要设置一个初始值
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String currentDate = sdf.format(new Date());
        try {
            this.orderTime = sdf.parse(currentDate);
        } catch (ParseException e) {
            System.out.println(e);
        }

    }
    public void setOrderID(Long orderID) 
    {
        this.orderID = orderID;
    }

    public Long getOrderID() 
    {
        return orderID;
    }
    public void setAllPrice(BigDecimal allPrice) 
    {
        this.allPrice = allPrice;
    }

    public BigDecimal getAllPrice() 
    {
        return allPrice;
    }
    public void setOrderTime(Date orderTime) 
    {
        this.orderTime = orderTime;
    }

    public Date getOrderTime() 
    {
        return orderTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderID", getOrderID())
            .append("allPrice", getAllPrice())
            .append("orderTime", getOrderTime())
            .toString();
    }
}
